<?php if(!defined('HDWIKI_ROOT')) exit('Access Denied');?>
<?php include $this->gettpl('admin_header');?>
<p class="map">全局：扩展设置</p>
<p class="sec_nav">扩展设置：
    <a href="index.php?admin_setting-sec" > <span>防灌水设置</span></a>
    <a href="index.php?admin_setting-anticopy" ><span>防采集设置</span></a>
    <a href="index.php?admin_setting-mail" class="on"><span>邮件设置</span></a>
    <a href="index.php?admin_setting-noticemail"><span>邮件提醒设置</span></a>
    <a href="index.php?admin_banned" ><span>IP禁止</span></a>
    <a href="index.php?admin_setting-passport" ><span>通行证设置</span></a>
    <a href="index.php?admin_setting-ucenter"><span>UCenter设置</span></a>
    <a href="index.php?admin_setting-ldap"><span>LDAP设置</span></a>
</p>
<h3 class="col-h3">邮件设置</h3>

<form method="POST" action="index.php?admin_setting-mail" >
	<table class="table">
		<tr>
			<td width="300px"><span>参数名称</span></td>
			<td><span>参数值</span></td>
		</tr>
		<tr>
			<td><span>默认邮件来源地址</span></td>
			<td><input class="inp_txt" name="maildefault"  maxlength="50" value="<?php if(!empty($mailconfig['maildefault'])) { ?><?php echo $mailconfig['maildefault']?><?php } else { ?><?php echo $adminemail?><?php } ?>" /></td>
		</tr>
		<tr>
			<td><span>发送方式</span></td>
			<td>
				
				<label><input class="radio" name="mailsend" value="1"<?php if($mailconfig['mailsend'] == 1 || empty($mailconfig['mailsend'])) { ?> checked="checked"<?php } ?> onclick="$('#hidden1, #hidden2').hide();" type="radio"> 通过 PHP 函数的 sendmail 发送(推荐此方式)</label><br />
				<label><input class="radio" name="mailsend" value="2"<?php if($mailconfig['mailsend'] == 2) { ?> checked="checked"<?php } ?> onclick="$('#hidden1, #hidden2').show();" type="radio"> 通过 SOCKET 连接 SMTP 服务器发送(支持 ESMTP 验证)</label><br />
				<label><input class="radio" name="mailsend" value="3"<?php if($mailconfig['mailsend'] == 3) { ?> checked="checked"<?php } ?> onclick="$('#hidden1').show();$('#hidden2').hide();" type="radio"> 通过 PHP 函数 SMTP 发送 Email(仅 Windows 主机下有效, 不支持 ESMTP 验证)</label>
				 
			</td>
		</tr>
		<tbody id="hidden1" <?php if($mailconfig['mailsend'] == 1 || empty($mailconfig['mailsend'])) { ?> style="display:none"<?php } ?>> 
		<tr>
			<td>SMTP服务器</td>
			<td><input class="inp_txt" name="mailserver" maxlength="100" value="<?php echo $mailconfig['mailserver']?>" type="text" /></td>
		</tr>
		<tr>
			<td >SMTP服务器端口</td>
			<td ><input class="inp_txt" name="mailport" maxlength="100" value="<?php echo $mailconfig['mailport']?>" type="text" /></td>
		</tr>
		
		</tbody>
		<tbody id="hidden2"<?php if($mailconfig['mailsend'] == 1 || $mailconfig['mailsend'] == 3 || empty($mailconfig['mailsend'])) { ?> style="display:none"<?php } ?>>
		<tr>
			<td >SMTP 服务器是否要求身份验证</td>
			<td >
				<label><input type="radio" class="radio" name="mailauth"<?php if($mailconfig['mailauth'] == 1) { ?> checked="checked"<?php } ?> value="1" />是</label>
				<label><input type="radio" class="radio" name="mailauth"<?php if($mailconfig['mailauth'] == 0) { ?> checked="checked"<?php } ?> value="0" />否</label>
			</td>
		</tr>
		<tr>
			<td >SMTP服务器的用户邮箱</td>
			<td ><input class="inp_txt" name="mailfrom"  maxlength="50" value="<?php echo $mailconfig['mailfrom']?>"></td>
		</tr>
		<tr>
			<td >SMTP服务器的用户帐号</td>
			<td ><input class="inp_txt" name="mailauth_username" maxlength="32" value="<?php echo $mailconfig['mailauth_username']?>"></td>
		</tr>
		<tr>
			<td >SMTP服务器的用户密码</td>
			<td ><input type="password" class="inp_txt" name="mailauth_password" maxlength="32" value="<?php echo $mailconfig['mailauth_password']?>"></td>
		</tr>
		</tbody>
		<tr>
			<td><span>邮件头的分隔符</span></td>
			<td>
				<label><input class="radio" name="maildelimiter"<?php if($mailconfig['maildelimiter'] == 1) { ?> checked="checked"<?php } ?> value="1" type="radio"> 使用 CRLF 作为分隔符(通常为 Windows 主机)</label><br />
				<label><input class="radio" name="maildelimiter"<?php if($mailconfig['maildelimiter'] == 0) { ?> checked="checked"<?php } ?> value="0" type="radio"> 使用 LF 作为分隔符(通常为 Unix/Linux 主机)</label><br />
				<label><input class="radio" name="maildelimiter"<?php if($mailconfig['maildelimiter'] == 2) { ?> checked="checked"<?php } ?> value="2" type="radio"> 使用 CR 作为分隔符(通常为 Mac 主机)</label>				 
			</td>
		</tr>		
		<tr>
			<td><span>收件人地址中是否包含用户名</span></td>
			<td>
				<label><input type="radio" class="radio" name="mailusername"<?php if($mailconfig['mailusername'] == 1) { ?> checked="checked"<?php } ?> value="1" />是</label>
				<label><input type="radio" class="radio" name="mailusername"<?php if($mailconfig['mailusername'] == 0) { ?> checked="checked"<?php } ?> value="0" />否</label>
			</td>
		</tr>		
		
		<tr>
			<td colspan="2"><input class="inp_btn" type="submit" value="保 存" name="mailsubmit" /></td>
		</tr>
	</table>
</form>

<?php include $this->gettpl('admin_footer');?>